#pragma once

#include "Pointer.h"

class Functor
{
public:
	virtual void operator()() = 0;
};

template<class T>
class CFunctor : public Functor
{
protected:
	Pointer<T> obj;
	typedef void (T::*funcType)();
	funcType func;
public:
	CFunctor(Pointer<T> o, funcType f)
	{
		obj = o;
		func = f;
	};
	void operator()()
	{
		(((T*)obj)->*func)();
	}
};
